package com.ch08a;

public class MyLinkedList {
	private String message = "Shine the light"; // (2)

	public Node makeInstance(String info, Node next) { // (3)
		return new Node(info, next); // (4)
	}

	public class Node { // (5) NSMC
		// static int maxNumOfNodes = 100; // (6) Not OK.
		final static int maxNumOfNodes = 100; // (7) OK.
		private String nodeInfo; // (8)
		private Node next;

		public Node(String nodeInfo, Node next) { // (9)
			this.nodeInfo = nodeInfo;
			this.next = next;
		}

		public String toString() {
			return message + " in " + nodeInfo + " (" + maxNumOfNodes + ")"; // (10)
		}
	}
}
